Make menu activation work again
authorMatthias Clasen <mclasen@redhat.com>
Sat, 6 Apr 2019 00:20:21 +0000 (00:20 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 6 Apr 2019 00:20:21 +0000 (00:20 +0000)
After we stopped untranslatable delivering events, menus stopped
working 'the second time'. After some painful debugging, it appears
that this is caused by the menushell code deliberately grabbing
on the menubar *after* grabbing on the menu, causing events to
be deleivered to the wrong toplevel. This did not use to matter,
but now we drop these events.

Absent a more thorough rewrite of menus, just don't grab on
the menubar. This makes menu activation work again and does not
appear to have ill effects, on either Wayland or X.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1796
gtk/gtkmenushell.c

index 2521b8368c629b03ec4afa2823391ea5da5aa19f..b538c5e011f71fb78bf41c4bed8d5c64f20f8a56 100644 (file)
@@ -708,7 +708,7 @@ multi_press_pressed (GtkGestureMultiPress *gesture,
               gtk_widget_get_parent (menu_item) == GTK_WIDGET (menu_shell) &&
               menu_item != priv->active_menu_item)
             {
-              gtk_menu_shell_activate (menu_shell);
+              priv->active = TRUE;
 
               if (GTK_MENU_SHELL_GET_CLASS (menu_shell)->submenu_placement == GTK_TOP_BOTTOM)
                 {